<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class WechatUser extends Model
{
    protected $fillable = ['unionid', 'openid', 'wechat_openid', 'name', 'head_img'];
    public function sectMember()
    {
        return $this->hasOne('App\Models\SectMember', 'user_id')->withDefault([
            'user_id' => 0,
            'sect_id' => 0,
            'title' => 100,
        ]);
    }

    public static function getWechatUsertList()
    {
        $array = Arenacontest::selectRaw("`id` ,`name`")
            ->pluck('name', 'id')
            ->toArray();
        return $array;
    }
}
